// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** datasourceOperation POST /v1/easyapi/server/datasource/datasourceOperation */
export async function datasourceOperationUsingPost(
  body: API.DataSourceOperationParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/v1/easyapi/server/datasource/datasourceOperation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteDatasource POST /v1/easyapi/server/datasource/deleteDatasource */
export async function deleteDatasourceUsingPost(
  body: API.DataSourceOperationParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/v1/easyapi/server/datasource/deleteDatasource', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getAllDatabases POST /v1/easyapi/server/datasource/getAllDatabases */
export async function getAllDatabasesUsingPost(
  body: API.DataSourceOperationParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListString_>('/v1/easyapi/server/datasource/getAllDatabases', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getAllTables POST /v1/easyapi/server/datasource/getAllTables */
export async function getAllTablesUsingPost(
  body: API.DataSourceOperationParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListString_>('/v1/easyapi/server/datasource/getAllTables', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getCreateTableSql POST /v1/easyapi/server/datasource/getCreateTableSql */
export async function getCreateTableSqlUsingPost(
  body: API.DataSourceOperationParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseString_>('/v1/easyapi/server/datasource/getCreateTableSql', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getTableData POST /v1/easyapi/server/datasource/getTableData */
export async function getTableDataUsingPost(
  body: API.DataSourceOperationParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListListString_>('/v1/easyapi/server/datasource/getTableData', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getTableStruct POST /v1/easyapi/server/datasource/getTableStruct */
export async function getTableStructUsingPost(
  body: API.DataSourceOperationParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListTableStruct_>('/v1/easyapi/server/datasource/getTableStruct', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** listDataSource GET /v1/easyapi/server/datasource/listDatasource */
export async function listDataSourceUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseListDataSourceListVo_>(
    '/v1/easyapi/server/datasource/listDatasource',
    {
      method: 'GET',
      ...(options || {}),
    },
  );
}

/** listDatasourceByProjectId POST /v1/easyapi/server/datasource/listDatasourceByProjectId */
export async function listDatasourceByProjectIdUsingPost(
  body: API.DataSourceOperationParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListDataSourceListVo_>(
    '/v1/easyapi/server/datasource/listDatasourceByProjectId',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** pageDatasource POST /v1/easyapi/server/datasource/pageDatasource */
export async function pageDatasourceUsingPost(
  body: API.DataSourcePageParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageDataSourcePageVo_>(
    '/v1/easyapi/server/datasource/pageDatasource',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** addDataSource POST /v1/easyapi/server/datasource/saveDatasource */
export async function addDataSourceUsingPost(
  body: API.AddDatasourceParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/v1/easyapi/server/datasource/saveDatasource', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** testDatasourceConnect POST /v1/easyapi/server/datasource/testDatasourceConnect */
export async function testDatasourceConnectUsingPost(
  body: API.AddDatasourceParam,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/v1/easyapi/server/datasource/testDatasourceConnect', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
